namespace utils {
    std::string getCurTime() {
        auto now = std::chrono::system_clock::now();
        auto now_time_t = std::chrono::system_clock::to_time_t(now);
        auto now_tm = *std::localtime(&now_time_t);
        std::ostringstream oss;
        oss << std::put_time(&now_tm, "%Y%m%d%H%M%S");
        return oss.str();
    }
    std::string bufRead(const std::string& filePath) {
        std::ifstream f(filePath, std::ios::binary); if (!f) return "";
        std::string buf((std::istreambuf_iterator<char>(f)),
            std::istreambuf_iterator<char>()); // "Most Vexing Parse" Problem
        return buf;
    }
    bool bufWriteSimp(std::string buf, const std::string& filePath) {
        std::ofstream f(filePath, std::ios::binary); if (!f) return 0;
        f.write(buf.data(), buf.size()); return 1;
    }
    template <typename... Args>
    void bufWrite(Args... args) {stubborn(bufWriteSimp, args...);}
}

using utils::getCurTime;
using utils::bufRead;
using utils::bufWrite;
